// pages/home/home.js
Page({

  /**
   * 页面的初始数据
   */
  data: {
    TabCur: 0,
    scrollLeft:0,
    tablist:["推荐","旅行","搞笑","穿搭","演员","汽车","娱乐","动物","美女","明星","美食","植物","影视","健身"],
    allNotelist:[
      {
        coverUrl:"/image/🦋小仙女-热巴.jpg",
      title:"🦋小仙女🤩🤩",
      headUrl:"/image/迪丽热巴头像.jpg",
      userName:"迪丽热巴",
      likeNum:"5501w",
      category:"0"
      },
      {
        coverUrl:"/image/王源.gif",
      title:"今天唱歌给你听🤩🤩，希望你天天开心！",
      headUrl:"/image/王源头像.jpg",
      userName:"tfboys-王源",
      likeNum:"888w",
      category:"0"
      },
      
      {
        coverUrl:"/image/演唱会.jpg",
      title:"❤其实我觉得没必要炫耀我见过薛之谦❤",
      headUrl:"/image/我的头像.jpg",
      userName:"昕情(登船版)",
      likeNum:"26w",
      category:"0"
      },
      {
        coverUrl:"/image/二次元头像.jpg",
      title:"老婆么么",
      headUrl:"/image/二次元.jpeg",
      userName:"阿西",
      likeNum:"1.1w",
      category:"0"
      },
      {
        coverUrl:"/image/fj.gif",
      title:"总要去看看外面的世界吧！——带上你的家人朋友",
      headUrl:"/image/我的头像.jpg",
      userName:"小情旅游社",
      likeNum:"1314w",
      category:"1"
      },
      {
        coverUrl:"/image/旅行3.gif",
      title:"全国省会唯有“这一局”长沙为何如此看重“知本”-三湘万象-湖南在线-华声在线",
      headUrl:"/image/旅行头像3.jpeg",
      userName:"长沙哥",
      likeNum:"70w",
      category:"1"
      },
      {
        coverUrl:"/image/旅行2.jpg",
      title:"云游全国新5A | 西藏林芝市雅鲁藏布大峡谷旅游景区：中国最美峡谷之首",
      headUrl:"/image/旅行头像2.jpg",
      userName:"带你玩转西藏",
      likeNum:"100w",
      category:"1"
      },
      {
        coverUrl:"/image/旅行4.jpg",
      title:"西安网红打卡地《西安千古情》，1小时沉浸式体验，感受辉煌西安！",
      headUrl:"/image/旅行头像4.jpg",
      userName:"凤凰网",
      likeNum:"9w",
      category:"1"
      },
      {
        coverUrl:"/image/旅行5.jpg",
      title:"内蒙古最值得去的十大风景区？",
      headUrl:"/image/旅行头像5.jpg",
      userName:"内蒙网",
      likeNum:"96",
      category:"1"
      },
      {
        coverUrl:"/image/旅行6.jpg",
      title:"象山旅游女性背影",
      headUrl:"/image/旅行头像6.jpg",
      userName:"甜甜",
      likeNum:"2",
      category:"1"
      },
      {
        coverUrl:"/image/搞笑1.gif",
      title:"我爸出轨了，帮妈妈想个对付我爸的办法❗️",
      headUrl:"/image/搞笑头像1.jpg",
      userName:"请叫我大王",
      likeNum:"14.6w",
      category:"2"
      },
      {
        coverUrl:"/image/搞笑2.gif",
      title:"以后老了可怎么办，又不会打麻将，也不会跳广场舞，要跟老头老太太打王者荣耀吗？",
      headUrl:"/image/搞笑头像2.jpg",
      userName:"大脑袋律师",
      likeNum:"36",
      category:"2"
      },
      {
        coverUrl:"/image/搞笑3.gif",
      title:"有人说我屁股大，笑死，没文化真可怕",
      headUrl:"/image/搞笑头像3.jpgg",
      userName:"高校日常",
      likeNum:"7.8w",
      category:"2"
      },
      {
        coverUrl:"/image/搞笑4.gif",
      title:"喝酒嘛，芝麻分700以上的约，太低了我怕你赖酒！",
      headUrl:"/image/搞笑头像4.jpg",
      userName:"云边有个文案馆",
      likeNum:"2273",
      category:"2"
      },
      {
        coverUrl:"/image/穿搭1.png",
      title:"小个子怎么穿？",
      headUrl:"/image/穿搭头像1.jpg",
      userName:"小情服装社",
      likeNum:"666w",
      category:"3"
      },
      {
        coverUrl:"/image/穿搭2.jpg",
      title:"怎样穿衣服搭配好看？",
      headUrl:"/image/穿搭头像2.jpg",
      userName:"魔力穿搭精",
      likeNum:"999",
      category:"3"
      },
      {
        coverUrl:"/image/穿搭3.jpg",
      title:"花衬衫4种穿搭公式，直击心底的潮流，轻松提升吸睛指数",
      headUrl:"/image/穿搭头像3.jpg",
      userName:"魔力穿搭精",
      likeNum:"1.6w",
      category:"3"
      },
      {
        coverUrl:"/image/穿搭4.png",
      title:"Dangerous People薛之谦dsp辣椒纸袋人字体图案秋冬潮流圆领卫衣",
      headUrl:"/image/穿搭头像4.jpg",
      userName:"dsp",
      likeNum:"96w",
      category:"3"
      },
      {
        coverUrl:"/image/影视1.jpg",
      title:"迪丽热巴古装剧确实好看，赏心悦目，每个剧的造型都给人惊艳感",
      headUrl:"/image/影视头像1.jpg",
      userName:"嘉行传媒",
      likeNum:"999w",
      category:"4"
      },
      {
        coverUrl:"/image/影视4.jpg",
      title:"臣妾做不到啊大气层诡辩——《腾讯视频》",
      headUrl:"/image/影视头像2.jpg",
      userName:"小黑子",
      likeNum:"9.9w",
      category:"4"
      },
      {
        coverUrl:"/image/影视3.gif",
      title:"已老实，求放过",
      headUrl:"/image/影视头像3.jpg",
      userName:"小奶糖",
      likeNum:"4w",
      category:"4"
      },
      {
        coverUrl:"/image/影视2.jpg",
      title:"《公诉精英》预计三月播出，期待迪丽热巴安旎！",
      headUrl:"/image/影视头像4.jpg",
      userName:"爱热巴一万年",
      likeNum:"89w",
      category:"4"
      },
      {
        coverUrl:"/image/汽车1.jpg",
      title:"Next Speed｜全新梅赛德斯-奔驰S级轿车全球首发，“最畅销的豪华轿车”还能打吗？",
      headUrl:"/image/汽车头像1.jpg",
      userName:"奔驰",
      likeNum:"9w",
      category:"5"
      },
      {
        coverUrl:"/image/汽车2.jpg",
      title:"帅爆了！宝马M8四门轿跑概念车发布：量产版2019年发布",
      headUrl:"/image/汽车头像2.jpg",
      userName:"宝马bb",
      likeNum:"20w",
      category:"5"
      },
      {
        coverUrl:"/image/汽车3.jpg",
      title:"10款适合女士开的自动挡的小型车推荐，囊括几万到几百万的车型",
      headUrl:"/image/汽车头像3.jpg",
      userName:"保时捷新闻网",
      likeNum:"630w",
      category:"5"
      },
      {
        coverUrl:"/image/汽车4.jpg",
      title:"一汽-大众大七座SUV揽境正式发布！预计三季度上市",
      headUrl:"/image/汽车头像4.jpg",
      userName:"新浪看点",
      likeNum:"675w",
      category:"5"
      },
      {
        coverUrl:"/image/娱乐1.jpg",
      title:"不是，斤斤计较的人别玩农场好吧",
      headUrl:"/image/娱乐头像1.jpg",
      userName:"尹涛",
      likeNum:"675",
      category:"6"
      },
      {
        coverUrl:"/image/娱乐2.jpg",
      title:"适合夏天的摆烂头像🍃",
      headUrl:"/image/娱乐头像2.jpg",
      userName:"钱都来我兜里",
      likeNum:"26",
      category:"6"
      },
      {
        coverUrl:"/image/娱乐3.jpg",
      title:"租房是大学生出社会的第一课",
      headUrl:"/image/娱乐头像3.jpg",
      userName:"铁血老人养成记",
      likeNum:"861",
      category:"6"
      },
      {
        coverUrl:"/image/娱乐4.jpg",
      title:"2024重新养自己一遍吧🌺",
      headUrl:"/image/娱乐头像4.jpg",
      userName:"爱养生的美女",
      likeNum:"111w",
      category:"6"
      },
      {
        coverUrl:"/image/动物1.jpg",
      title:"左划⬅️和小猫贴贴谁懂 好喜欢贴脸照",
      headUrl:"/image/动物头像1.jpg",
      userName:"半糖忧伤",
      likeNum:"40w",
      category:"7"
      },
      {
        coverUrl:"/image/动物2.gif",
      title:"今天又是被花花治愈的一天，太可爱了吧。 好乖 好小一只∗︎˚(* ˃̤൬˂̤ *)",
      headUrl:"/image/动物头像2.jpg",
      userName:"花生日记",
      likeNum:"360w",
      category:"7"
      },
      {
        coverUrl:"/image/动物3.jpg",
      title:"它好像知道自己很可爱",
      headUrl:"/image/动物头像3.jpg",
      userName:"一颗小土豆",
      likeNum:"8w",
      category:"7"
      },
      {
        coverUrl:"/image/动物4.jpg",
      title:"好朋友当然要一起拍照啦！好和谐！好有爱！",
      headUrl:"/image/动物头像4.jpg",
      userName:"宠物摄影",
      likeNum:"8889",
      category:"7"
      },
      {
        coverUrl:"/image/美女4.gif",
      title:"妩媚妖娆的美女❀",
      headUrl:"/image/美女头像4.jpg",
      userName:"休息中",
      likeNum:"2.1w",
      category:"8"
      },
      {
        coverUrl:"/image/美女1.jpg",
      title:"迪丽热巴是玫瑰庄园里走出来的公主趴",
      headUrl:"/image/美女头像1.jpg",
      userName:"迪丽迪丽~热巴",
      likeNum:"79w",
      category:"8"
      },
      {
        coverUrl:"/image/美女2.jpg",
      title:"那些再也拍不出第二张的美丽照片希望还能拍出更多～",
      headUrl:"/image/美女头像2.jpg",
      userName:"小兰同学",
      likeNum:"71",
      category:"8"
      },
      {
        coverUrl:"/image/美女3.jpg",
      title:"本人来了！你看到的这些网图头像都是我！有图可晒，今日朋友圈营业。实力摄影师",
      headUrl:"/image/美女头像3.jpg",
      userName:"小于摄影",
      likeNum:"9w",
      category:"8"
      },
      {
        coverUrl:"/image/明星1.gif",
      title:"老薛你别太搞笑",
      headUrl:"/image/明星头像1.jpg",
      userName:"y",
      likeNum:"99w",
      category:"9"
      },
      {
        coverUrl:"/image/明星2.gif",
      title:"见到了你们老公王源！！状态好好！！！！还回头了不愧是顶流啊啊啊啊！！侧脸杀😭最后还回头了一下🥺",
      headUrl:"/image/明星头像2.jpg",
      userName:"源芋泥",
      likeNum:"101w",
      category:"9"
      },
      {
        coverUrl:"/image/明星3.gif",
      title:"外面太冷来我怀里躲躲",
      headUrl:"/image/明星头像3.jpg",
      userName:"王源创想原野",
      likeNum:"85w",
      category:"9"
      },
      {
        coverUrl:"/image/明星4.gif",
      title:"迪丽热巴你是要要要勾我的魂呐~我堵你们没见过这神颜",
      headUrl:"/image/明星头像4.jpg",
      userName:"万渣",
      likeNum:"40w",
      category:"9"
      },
      {
        coverUrl:"/image/美食1.jpg",
      title:"贵州羊肉粉——男朋友最爱吃的美食，真的巨巨巨好吃！！！",
      headUrl:"/image/美食头像1.jpg",
      userName:"大白美食",
      likeNum:"5001",
      category:"10"
      },
      {
        coverUrl:"/image/美食2.jpg",
      title:"威海！会带每一任男朋友来吃的餐厅…",
      headUrl:"/image/美食头像2.jpg",
      userName:"小情爱吃饭",
      likeNum:"9w",
      category:"10"
      },
      {
        coverUrl:"/image/美食4.jpg",
      title:"来长沙下高铁🚄毫不犹豫直奔这里……",
      headUrl:"/image/美食头像4.jpg",
      userName:"多多",
      likeNum:"305",
      category:"10"
      },
      {
        coverUrl:"/image/美食3.jpg",
      title:"穷鬼快乐屋！便宜好吃！！68r吃撑四个人",
      headUrl:"/image/美食头像3.jpg",
      userName:"走着瞧",
      likeNum:"645",
      category:"10"
      },
      {
        coverUrl:"/image/植物1.jpg",
      title:"深圳📍这多肉真的拒绝不了多肉都是小可爱小花也是的",
      headUrl:"/image/植物头像1.jpg",
      userName:"深深浅浅",
      likeNum:"82",
      category:"11"
      },
      {
        coverUrl:"/image/植物2.jpg",
      title:"共享郁金香花海🌷🌈",
      headUrl:"/image/植物头像2.jpg",
      userName:"小悟空",
      likeNum:"6w",
      category:"11"
      },
      {
        coverUrl:"/image/植物3.gif",
      title:"下雨天然氧吧！山涧美的跟仙境似的，雨雾缭绕，绿意盎然",
      headUrl:"/image/植物头像3.jpg",
      userName:"五仁月饼",
      likeNum:"3",
      category:"11"
      },
      {
        coverUrl:"/image/植物4.jpg",
      title:"爬山虎偷偷告诉我❗️绿色☘️才是春天醉美文案",
      headUrl:"/image/植物头像4.jpg",
      userName:"沐沐",
      likeNum:"17w",
      category:"11"
      },
      {
        coverUrl:"/image/演员1.jpg",
      title:"请清风送鼓声！请苍天辨忠奸！",
      headUrl:"/image/演员头像1.jpg",
      userName:"yp3",
      likeNum:"1.6w",
      category:"12"
      },
      {
        coverUrl:"/image/演员2.jpg",
      title:"谁懂啊 荣耀夫妇真的太甜了",
      headUrl:"/image/演员头像2.jpg",
      userName:"洋迪夫妇今天结婚",
      likeNum:"9999w",
      category:"12"
      },
      {
        coverUrl:"/image/演员3.jpg",
      title:"他武艺高强，他用毒高手，他全国首富，他执掌大权，他一人独尊！他们就是我的五个爹爹！时隔五年，我带着我的五个爹杀回来了！",
      headUrl:"/image/演员头像3.jpg",
      userName:"NANA",
      likeNum:"421w",
      category:"12"
      },
      {
        coverUrl:"/image/演员4.jpg",
      title:"有被创到！我们的少年时代已经过去很多年了",
      headUrl:"/image/演员头像4.jpg",
      userName:"左脸甜菜",
      likeNum:"65w",
      category:"12"
      },
      {
        coverUrl:"/image/健身海报晨跑美女.jpg",
      title:"美好的一天从晨跑开始",
      headUrl:"/image/健身头像4.jpg",
      userName:"小美",
      likeNum:"100w",
      category:"13"
      },
      {
        coverUrl:"/image/keep推动中国女性健身市场的大玩家.jpeg",
      title:"keep推动中国女性健身市场的大玩家",
      headUrl:"/image/健身头像1.jpg",
      userName:"keep",
      likeNum:"2099",
      category:"13"
      },
      {
        coverUrl:"/image/健身女孩.gif",
      title:"热爱运动",
      headUrl:"/image/健身头像2.jpg",
      userName:"☀",
      likeNum:"39",
      category:"13"
      },
      {
        coverUrl:"/image/帕梅拉.jpg",
      title:"Hello！大家好，我是帕梅拉。",
      headUrl:"/image/健身头像3.jpg",
      userName:"帕梅拉",
      likeNum:"6w",
      category:"13"
      },
    ]
  },
  tabSelect(e) {
    let categoryId = e.currentTarget.dataset.id;
    let  notelist = this.data.allNotelist;
    let newNoteList = [];
    for (let index = 0; index < notelist.length;index++) {
      if(notelist[index].category ==categoryId){
        newNoteList.push(notelist[index])
      }
    
    }
    this.setData({
      TabCur: e.currentTarget.dataset.id,
      scrollLeft: (e.currentTarget.dataset.id-1)*60,
      notelist:newNoteList
    })
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad(options) {
    let categoryId = 0;
    let  notelist = this.data.allNotelist;
    let newNoteList = [];
    for (let index = 0; index < notelist.length;index++) {
      if(notelist[index].category ==categoryId){
        newNoteList.push(notelist[index])
      }
    }
    this.setData({
      notelist:newNoteList
    })
  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady() {

  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow() {

  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide() {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload() {

  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh() {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom() {

  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage() {

  }
})